import request from '@/config/axios'

// 设备报警授权 VO
export interface DeviceAuthVO {
  id: number // 编号
  deviceId: number // 设备ID
  alarmId: number // 报警配置ID
  userId: number // 用户ID
  userName: string // 用户账号
  openWeixin: string // 微信通知
  openSms: string // 短信通知
  ararmStatus: string // 是否启用
  description: string // 描述
}

// 设备报警授权 API
export const DeviceAuthApi = {
  // 查询设备报警授权分页
  getDeviceAuthPage: async (params: any) => {
    return await request.get({ url: `/mqtt/device-auth/page`, params })
  },

  // 查询设备报警授权详情
  getDeviceAuth: async (id: number) => {
    return await request.get({ url: `/mqtt/device-auth/get?id=` + id })
  },

  // 新增设备报警授权
  createDeviceAuth: async (data: DeviceAuthVO) => {
    return await request.post({ url: `/mqtt/device-auth/create`, data })
  },

  // 修改设备报警授权
  updateDeviceAuth: async (data: DeviceAuthVO) => {
    return await request.put({ url: `/mqtt/device-auth/update`, data })
  },

  // 删除设备报警授权
  deleteDeviceAuth: async (id: number) => {
    return await request.delete({ url: `/mqtt/device-auth/delete?id=` + id })
  },

  // 导出设备报警授权 Excel
  exportDeviceAuth: async (params) => {
    return await request.download({ url: `/mqtt/device-auth/export-excel`, params })
  }
}